import { marked } from 'marked'
// 渲染内容的辅助方法
export function renderContent(div, content, isHtml) {
  try {
    if (isHtml) {
      div.innerHTML = content
    } else {
      const htmlContent = marked(content)
      div.innerHTML = htmlContent


    }


  } catch (error) {
    console.error('内容渲染错误:', error)
    div.textContent = content
  }
}

export function str2html(content) {
  try {
   const htmlContent = marked(content)
   return htmlContent
  } catch (error) {
    console.error('内容渲染错误:', error)
    div.textContent = content
  }
}